package com.wx.nbregisterserver.context;


import com.wx.nbregisterserver.entity.ServerInfomation;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;

@Component
public class RegistMesgContext {



    private static ArrayList<HashMap<String, ServerInfomation>>  arrayList=new ArrayList();

    /**
     * 把参数放入到注册信息上下文中
     */

    public void putMesg(HashMap<String, ServerInfomation> map){
        arrayList.add(0,map);
    }

    /**
     * 从上下文中取出数据
     */

    public HashMap<String, ServerInfomation> getMesg(){

        if(arrayList!=null){

            HashMap<String, ServerInfomation> stringServerInfomationHashMap = arrayList.get(0);
            return stringServerInfomationHashMap;
        }else {
            return null;
        }


    }


}
